package cn.lyvust.demo.shili07;

/**
 * Description:
 * date: 2021-5-11 22:55
 *
 * @author Guo_guo
 * @since JDK 1.8
 */
public class LisiThread {
    public static void main(String[] args) {
        Runnable r = new LisiRunnable();
        Thread t1 = new Thread(r,"线程A-熊大");//通过构造方法指定线程名
        Thread t2 = new Thread(r,"线程B-熊二");
        //设置线程的优先级（对比演示设置前后设置后的结果）
//        t1.setPriority(Thread.MAX_PRIORITY);
//        t2.setPriority(Thread.MIN_PRIORITY);
        System.out.println("****线程的优先级****");
        System.out.println("线程A的优先级："+t1.getPriority());
        System.out.println("线程B的优先级："+t2.getPriority());
        System.out.println("****************");
        t1.start();
        t2.start();
    }
}
